package com.qqt.csr.file.vo.req;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.qqt.csr.common.enums.FileTypeEnum;
import com.qqt.csr.common.idempotent.RequestKeyParam;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.*;
import lombok.experimental.Accessors;

import java.io.Serial;
import java.io.Serializable;

@Getter
@Setter
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = true)
@JsonIgnoreProperties(ignoreUnknown = true)
@Schema(name = "InitMultiUploadReq", description = "初始化分段上传任务")
public class InitMultiUploadReq implements Serializable {
    @Serial
    private static final long serialVersionUID = -2096773403653641434L;

    @Schema(description = "文件的md5", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "文件的md5不能为空")
    @RequestKeyParam
    private String md5;

    @Schema(description = "文件名", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "文件名不能为空")
    private String fileName;

    @Schema(description = "文件总大小", requiredMode = Schema.RequiredMode.REQUIRED)
    @Min(value = 1, message = "文件总大小不能小于1")
    private long fileSize;

    @Schema(description = "文件类型", hidden = true)
    private FileTypeEnum fileTypeEnum;
}
